package com.example.demo.zabbix.request.builder.valuemap;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/valuemap/create
 */
public class ValueMapCreateRequestBuilder extends CreateRequestBuilder {
    private String name;
    private List<Map<String,Object>> mappings;
    public ValueMapCreateRequestBuilder(String auth) {
        super("valuemap.create", auth);
    }

    public ValueMapCreateRequestBuilder(Long id, String auth) {
        super("valuemap.create", id, auth);
    }

    public String getName() {
        return name;
    }

    public ValueMapCreateRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public List<Map<String, Object>> getMappings() {
        return mappings;
    }

    public ValueMapCreateRequestBuilder setMappings(List<Map<String, Object>> mappings) {
        this.mappings = mappings;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("name",name);
        baseRequest.getParams().put("mappings",mappings);
        return baseRequest;
    }
}
